import request from '@/utils/request'

// 查询流程分类树
export function typeTreeSelect(typeId) {
  return request({
    url: '/workflow/definition/typeTree',
    method: 'get'
  })
}

// 查询流程定义列表
export function listDefinition(query) {
  return request({
    url: '/workflow/definition/list',
    method: 'get',
    params: query
  })
}

export function addDefinition(data) {
  return request({
    url: '/workflow/definition/',
    method: 'post',
    data: data
  })
}

export function updateDefinition(data) {
  return request({
    url: '/workflow/definition/',
    method: 'put',
    data: data
  })
}

// 查询流程分类详细
export function getDefinition(typeId) {
  return request({
    url: '/workflow/definition/' + typeId,
    method: 'get'
  })
}
